System
Example
The text depends on the language chosen in OLEM's settings, then the example waits for the power button to be pressed.
import olem
if olem.get_sys_language() == "FR":
question = "Appuyez sur le bouton"
answer = "Merci !"
else:
question = "Press the button"
answer = "Thank you!"
text = olem.display_text(question, olem.FONT_DEFAULT, olem.ALIGN_CENTER)
olem.display_center(text)
# The state is 0 while the button is pressed
while olem.get_power_button_state() == 1:
olem.delay_ms(20)
olem.display_set_text(text, answer)
olem.delay_ms(2000)
Functions
get_sys_language()
Returns: language chosen in OLEM's settings: "EN" for English, "FR" for French
get_power_button_state()
Returns: 0 while the power button is pressed, 1 otherwise